import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_shensu/common/model/game.dart';
import 'package:flutter_shensu/page/home_page.dart';

import 'package:flutter_shensu/page/ispeed_page.dart';
import 'package:flutter_shensu/page/main_page.dart';

/**
 *  路由跳转工具类
 */
class NavigatorUtils {
  static pushReplacementNamed(BuildContext context, String routeName) {
    Navigator.pushReplacementNamed(context, routeName);
  }

  /// 主页
  static goHome(BuildContext context) {
    Navigator.pushReplacementNamed(context, HomePage.sName);
  }

  /// 主页
  static goMainPage(BuildContext context) {
    Navigator.pushReplacementNamed(context, NewMainPage.sName);
  }

  /// 加速页面
  static goISpeedPage(BuildContext context,Game game) {
    NavigatorRouter(context,new ISpeedPage(game));
  }

  static NavigatorRouter(BuildContext context, Widget widget) {
    return Navigator.push(
        context, new CupertinoPageRoute(builder: (context) => widget));
  }
}
